package com.wwj.airline.Controller;

import com.wwj.airline.Dao.PayMapper;
import com.wwj.airline.pojo.Pay;
import com.wwj.airline.pojo.Seat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private PayMapper payMapper;

    @PostMapping("/save")
    public void save(@RequestBody Pay pay){
        payMapper.save(pay);
    }

    @GetMapping("/findAll/{id}")
    public List<Pay> findAll(@PathVariable Long id){
        return payMapper.findAll(id);
    }

    @PostMapping("/delete/{id}")
    public void deleteById(@PathVariable Long id){
        payMapper.delete(id);
    }
}
